import Vue from "vue";
import VueRouter from "vue-router";
import Index from "../views/index/index";
import Query from "@/views/visualized/query";
import ElementUI from "element-ui";
import ConfigAdmin from "@/views/configAdmin/index";
import UpdateUser from "@/views/updateUser/index";
import Chart from "@/views/chart/index"
import "element-ui/lib/theme-chalk/index.css";
Vue.use(ElementUI);

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect: "/index",
  },
  {
    path: "/index",
    name: "Index",
    component: Index,
    children: [
      {
        path: "/query",
        name: "query",
        component: Query,
      },
      {
        path: "/configAdmin",
        name: "configAdmin",
        component: ConfigAdmin,
      },
      {
        path: "/updateUser",
        name: "updateUser",
        component: UpdateUser,
      },
      {
        path: "/chart",
        name: "chart",
        component: Chart,
      },
    ],
  },
];

const router = new VueRouter({
  routes,
});

export default router;
